//
//  WQVisitorViewController.swift
//  WeiBo
//
//  Created by Xmen on 16/9/20.
//  Copyright © 2016年 111. All rights reserved.
//

import UIKit

class WQVisitorViewController: UITableViewController {

    // 是否是访问属性
    var isLogin: Bool = WQUserAccountModel.sharedUserAccountViewModel.isLogin
    // 访问视图
    var visitorView: WQVisitor?
    
    
    override func loadView() {
        if isLogin {
            super.loadView()
        } else {
            visitorView = WQVisitor()
            visitorView?.loginClosure = { [weak self] in
                print("bibaodiaoyong")
            }
            view = visitorView
            setupNavUI()
        }
    }
    
    
    func setupNavUI() {
        self.navigationItem.leftBarButtonItem = UIBarButtonItem(title: "登录", target: self, action: #selector(clickLoginAction))
        self.navigationItem.rightBarButtonItem = UIBarButtonItem(title: "取消", target: self, action: #selector(clickLoginAction))
    }
    
    @objc private func clickLoginAction(){
        print("dianji")
        let WQOAuthVC = WQOAuthViewController()
        let nav = WQNavigationViewController(rootViewController: WQOAuthVC)
        present(nav, animated: true, completion: nil)
 
        
    }
    override func viewDidLoad() {
        super.viewDidLoad()

    }




}


